// EnumDevicePropertyDlg.h : header file
//

#if !defined(AFX_ENUMDEVICEPROPERTYDLG_H__60BA9604_4738_422A_8ACC_F56854F423CB__INCLUDED_)
#define AFX_ENUMDEVICEPROPERTYDLG_H__60BA9604_4738_422A_8ACC_F56854F423CB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "SetupAPI.h"
#include "cfgmgr32.h"
#include <vector>

using namespace std;

typedef struct _tagDeviceProperties
{
	int ID;
	TCHAR Property[100];
	TCHAR PropertyValue[500];
} DeviceProperties;

typedef struct _tagDevicePropertiesDN
{
	DEVNODE dn;
	DeviceProperties Properties[26];
} DevicePropertiesDN;

/////////////////////////////////////////////////////////////////////////////
// CEnumDevicePropertyDlg dialog

class CEnumDevicePropertyDlg : public CDialog
{
// Construction
public:
	CString GetDeviceName(DEVNODE DevNode);
	void RetrieveSubNodes(DEVINST parent, DEVINST sibling, DEVNODE dn);
	void EnumDevices();
	CEnumDevicePropertyDlg(CWnd* pParent = NULL);	// standard constructor


public:
	CString GetProperty(DEVNODE dn, ULONG Property);
	void EnumDeviceProperties(DEVNODE dn);
	HMACHINE m_hMachine;
	SP_CLASSIMAGELIST_DATA m_ImageListData;
	CImageList m_ImageList;
	vector<DevicePropertiesDN> DeviceProperty;

// Dialog Data
	//{{AFX_DATA(CEnumDevicePropertyDlg)
	enum { IDD = IDD_ENUMDEVICEPROPERTY_DIALOG };
	CListBox	m_Property;
	CListCtrl	m_Devices;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CEnumDevicePropertyDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CEnumDevicePropertyDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnDestroy();
	afx_msg void OnClickDeviceList(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ENUMDEVICEPROPERTYDLG_H__60BA9604_4738_422A_8ACC_F56854F423CB__INCLUDED_)
